package com.wish233.config;

import com.wish233.loadbalance.LoadBalancerKeys;
import com.wish233.retry.RetryStrategyKey;
import com.wish233.serializer.SerializerKeys;
import com.wish233.tolerant.TolerantStrategyKeys;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.util.Map;

/**
 * RPC 框架配置
 *
 * @author WHH
 */
@Data
@EqualsAndHashCode
@ToString
public class RpcConfig {

    /**
     * 名称
     */
    private String name = "wish-rpc";

    /**
     * 版本号
     */
    private String version = "1.0";

    /**
     * 服务器主机名
     */
    private String serverHost = "localhost";

    /**
     * 服务器端口号
     */
    private Integer serverPort = 8111;

    /**
     * 是否启用mock模式
     */
    private boolean mock = false;

    /**
     * 序列化器
     */
    private String serializer = SerializerKeys.JDK;

    /**
     * 注册中心配置
     */
    private RegistryConfig registryConfig = new RegistryConfig();

    /**
     * 负载均衡器
     */
    private String loadBalancer = LoadBalancerKeys.ROUND_ROBIN;
    /**
     * 重试策略
     */
    private String retryStrategy = RetryStrategyKey.NO_RETRY_STRATEGY;
    /**
     * 容错机制
     */
    private String tolerantStrategy = TolerantStrategyKeys.FAIL_FAST;
}
